Fix topology scheduling rule: anti-affinity, feature gates, PDB guidance#18
Merged
openshift-merge-bot[bot] merged 1 commit intoJun 4, 2026
Conversation
- Fix anti-affinity recommendation: required anti-affinity with maxUnavailable >= 1 is the correct pattern (used by oauth, openshift- apiserver, image-registry, monitoring). Preferred anti-affinity allows pod co-location, which caused OCPBUGS-65984 (74-second Available=False on two-node fencing when both pods landed on the same node). - Flag the dangerous combination (required anti-affinity + maxUnavailable: 0) instead of flagging required anti-affinity alone. - Make feature gate references version-agnostic: remove hardcoded "tech preview" status and specific feature gate names that change between releases. Point to openshift/api as the source of truth. - Fix wrong feature gate name: DualReplicaTopology -> DualReplica. - Fix wrong label: role.kubernetes.io/arbiter -> node-role.kubernetes.io/arbiter. - Add PDB limitation: PDBs do not protect against TaintManagerEviction (node fencing), only the eviction API (kubectl drain). - Recommend library-go topology-aware scheduling hooks for DeploymentController-based operators.
Contributor
Author
|
/cc @dgoodwin |
Contributor
|
/lgtm Thanks Luis! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgoodwin, sanchezl The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes and improvements to the "Topology-Aware Scheduling Compatibility" review rule based on findings from OCPBUGS-65984 investigation and a cross-operator scheduling survey.
Bug fixes
DualReplicaTopology→DualReplica(the enhancement proposedDualReplicaTopologybut the implementation inopenshift/api/features/features.gousesDualReplica)role.kubernetes.io/arbiter→node-role.kubernetes.io/arbiter(missingnode-prefix)HighlyAvailableArbiterwas listed as requiring a feature gate, but it is ungated in the API enum.DualReplicawas listed as tech preview but is now enabled by default.Anti-affinity guidance reversal
The previous rule recommended
preferredDuringSchedulingIgnoredDuringExecutionas the safe alternative to required anti-affinity. This recommendation directly caused OCPBUGS-65984: KSVMO#149 followed it, both migrator pods landed on the same node during a bootstrap timing race, and a 74-secondAvailable=Falseoutage occurred when that node was fenced. Every other HA operator (oauth-openshift, openshift-apiserver, image-registry, monitoring) uses required anti-affinity and survived the same fencing event.The rule now correctly identifies the dangerous combination as required anti-affinity +
maxUnavailable: 0(which deadlocks), not required anti-affinity alone. The recommendation is to use required anti-affinity withmaxUnavailable >= 1.Version-agnostic feature gate references
Feature gate status (TechPreview vs Default) changes between releases, and this rule applies across all branches. Removed hardcoded "tech preview" labels and specific feature gate names. Instead points to
openshift/apias the source of truth for the target release.New guidance
TaintManagerEviction(node fencing/unreachable taints) — only the eviction API (kubectl drain).WithTopologyAwareReplicasHook,WithTopologyAwareSchedulingHook, andWithControlPlaneNodeSelectorHookfrom library-go#2276 for DeploymentController-based operators.References